<?php
namespace app\index\controller;

use think\Controller;

class Single extends Common
{

	public function _initialize()
    {   
        parent::_initialize();
    }

    /**
    * 模板 单页
    * @param  id 单页内容类型
    * @author 张杰
    * @time
    */
    public function singlepage(){
        if(!empty(input('id'))){
            $id = input('id');
            $where['id'] = ['eq',$id];
            $query = db('article_page')->where($where)->find();
            $this->assign('page',$query);
            //查询单页内容
            return $this->fetch();
        }else{
            //跳转页面404;
            header("Location:/index/nohtml");
        }
        
    }

}
